package com._4cmd.rest;

import java.util.HashSet;
import java.util.Set;

import javax.ws.rs.core.Application;

import com._4cmd.conf.EnvConstants;
import com._4cmd.rest.service.VPNService;

public class Bootstrap extends Application {
	private Set<Object> singletons = new HashSet<Object>();
 
	public Bootstrap() {
		checkEnv();
		singletons.add(new VPNService());
	}
 
	@Override
	public Set<Object> getSingletons() {
		return singletons;
	}
	
	private static void checkEnv(){
		if(System.getProperty(EnvConstants.APP_HOME) == null){
			System.out.println(EnvConstants.APP_HOME + " is not specified in java env variables, please start server with -D4TODO_HOME=<4Todo root path> as JVM parameter.");
			System.exit(-1);
		}
	}
}
